home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-08-26 | 39.8 KB | 1,647 lines |
- TABLE OF CONTENTS
-
-
- Standard AppShell Application Functions
-
- appshell.library/ACTIVATE
- appshell.library/ALIAS
- appshell.library/CMDSHELL
- appshell.library/DISABLE
- appshell.library/ENABLE
- appshell.library/HOTKEY
- appshell.library/RX
- appshell.library/TOBACK
- appshell.library/TOFRONT
- appshell.library/VERSION
- appshell.library/WHY
- appshell.library/WINDOW
-
-
- AppShell Link Library Functions
-
- appshell.lib/HandleApp
- appshell.lib/NotifyUser
- appshell.library/AddFuncEntries
- appshell.library/AddFuncEntry
- appshell.library/AddProjects
- appshell.library/APSHClearPointer
- appshell.library/APSHGetGadgetInfo
- appshell.library/APSHGetWindowInfo
- appshell.library/APSHSetWaitPointer
- appshell.library/BuildParseLine
- appshell.library/FindType
- appshell.library/FreeParseLine
- appshell.library/FreeProject
- appshell.library/FreeProjects
- appshell.library/GetFuncEntry
- appshell.library/GetFuncID
- appshell.library/GetFuncName
- appshell.library/GetProjNode
- appshell.library/GetText
- appshell.library/HandleAppAsync
- appshell.library/HandlerData
- appshell.library/HandlerFunc
- appshell.library/IconFromWBArg
- appshell.library/MatchValue
- appshell.library/NewProject
- appshell.library/ParseLine
- appshell.library/PerfFunc
- appshell.library/PrepText
- appshell.library/QStrCmpI
- appshell.library/RemoveMsgPort
- appshell.library/RemoveProject
- appshell.library/SwapProjNodes
- appshell.library/ACTIVATE appshell.library/ACTIVATE
-
- NAME
- ACTIVATE - Activate an AppShell window.
-
- SYNOPSIS
- ActivateID Function ID
- ActivateFunc Function prototype
-
- FUNCTION
- Provides a mechanism to activate an AppShell window. Activation
- involves bring the screen to front, opening the window if it is
- hidden, bringing the window to front and unzooming the window if it
- is zoomed.
-
- As a string command line:
-
- ACTIVATE [name]
-
- where [name] is a valid window name, defaults to MAIN.
-
- As a TagItem attribute list:
-
- APSH_NameTag, <name>
- where <name> is a valid window name.
-
- APSH_WinPointer, <pointer>
- where <pointer> points to a valid window structure.
-
- This function is implemented by the IDCMP message handler.
-
- SEE ALSO
- TOBACK, TOFRONT, WINDOW
-
- appshell.library/ALIAS appshell.library/ALIAS
-
- NAME
- ALIAS - Used to build new commands from existing commands.
-
- SYNOPSIS
- AliasID Function ID
- AliasFunc Function prototype
-
- FUNCTION
- This command is used to build new commands from existing commands
- in the function table.
-
- As a string command line:
-
- ALIAS <new> <existing> [parameters]
-
- where <new> is the new command to add to the function
- table.
-
- where <existing> is an existing command in the function
- table to assign to the new command.
-
- where [parameters] are optional parameters for <existing>
- to assign to <new>.
-
- EXAMPLE
-
- The following command line would assign the command OPEN to the
- new command name README, and would use READ.ME as the parameter
- to pass.
-
- ALIAS README OPEN READ.ME
-
- BUGS
- No tags are implemented.
-
- appshell.library/CMDSHELL appshell.library/CMDSHELL
-
- NAME
- CMDSHELL - Open/Close the application command shell.
-
- SYNOPSIS
- CMDShellID Function ID
- CMDShellFunc Function prototype
-
- FUNCTION
- Opens a console window whereby the user can interact directly with
- the application at a command level. Allows the user quick access
- to functions or macros that they may use so infrequently that they
- don't wish to bind them to a key, menu or button.
-
- As a string command line:
-
- CMDSHELL [command]
- where [command] is a valid command, defaults to OPEN.
-
- OPEN Open the command shell.
-
- As a TagItem attribute list:
-
- APSH_Command, <command>
- where <command> is a valid command, defaults to MH_OPEN.
-
- MH_OPEN Open the command shell.
-
- This function is implemented by the DOS message handler.
-
- appshell.library/DISABLE appshell.library/DISABLE
-
- NAME
- DISABLE - Disable a function and its interfaces.
-
- SYNOPSIS
- DisableID Function ID
- DisableFunc Function prototype
-
- FUNCTION
- This function allows an application or user to disable a function.
-
- If the function is attached to a gadget or menu item, then that item
- is also disabled.
-
- As a string command line:
-
- DISABLE [name]
-
- where [name] is a valid function name.
-
- As a TagItem attribute list:
-
- APSH_NameTag, <name>
- where <name> is a valid function name.
-
- SEE ALSO
- ENABLE
-
- appshell.library/ENABLE appshell.library/ENABLE
-
- NAME
- ENABLE - Enable a function and its interfaces.
-
- SYNOPSIS
- EnableID Function ID
- EnableFunc Function prototype
-
- FUNCTION
- This function allows an application or user to enable a function.
-
- If the function is attached to a gadget or menu item, then that item
- is also enabled.
-
- As a string command line:
-
- ENABLE [name]
-
- where [name] is a valid function name.
-
- As a TagItem attribute list:
-
- APSH_NameTag, <name>
- where <name> is a valid function name.
-
- SEE ALSO
- DISABLE
-
- appshell.library/HOTKEY appshell.library/HOTKEY
-
- NAME
- HOTKEY - Bind a keyboard command to a function.
-
- SYNOPSIS
- HotKeyID Function ID
- HotKeyFunc Function prototype
-
- FUNCTION
- Provides a mechanism to bind a function to a keystroke or sequence
- of keystrokes.
-
- As a string command line:
-
- HOTKEY <key> <function name>
-
- where <key> is the keystroke.
-
- where <function name> is a valid function name.
-
- As a TagItem attribute list:
-
-
- APSH_CmdData, <key>
- where <key> is the keystroke.
-
- APSH_NameTag, <function name>
- where <function name> is a valid function name.
-
- This function is implemented by the IDCMP message handler.
-
- BUGS
- Currently doesn't support anything but single, shifted and unshifted,
- alphabetic characters [when called from the command line].
-
- appshell.library/RX appshell.library/RX
-
- NAME
- RX - Pass a command through ARexx.
-
- SYNOPSIS
- RXID Function ID
- RXFunc Function prototype
-
- FUNCTION
- Allows access to ARexx functions that may have otherwise been
- rerouted by the application. Should only be used if there are name
- conflicts between an application function and an ARexx function.
-
- As a string command line:
-
- RX [command]
-
- where [command] is a command line to pass to ARexx.
-
- As a TagItem attribute list:
-
- APSH_CmdString, <command>
- where <command> is a command line to pass to ARexx.
-
- This function is implemented by the ARexx message handler.
-
- BUGS
- Not currently implemented.
-
- appshell.library/TOBACK appshell.library/TOBACK
-
- NAME
- TOBACK - Send an AppShell window to the back.
-
- SYNOPSIS
- ToBackID Function ID
- ToBackFunc Function prototype
-
- FUNCTION
- Provides a mechanism to send an AppShell window to the back of the
- other windows on the same screen.
-
- As a string command line:
-
- TOBACK [name]
-
- where [name] is a valid window name, defaults to MAIN.
-
- As a TagItem attribute list:
-
- APSH_NameTag, <name>
- where <name> is a valid window name.
-
- APSH_WinPointer, <pointer>
- where <pointer> points to a valid window structure.
-
- This function is implemented by the IDCMP message handler.
-
- SEE ALSO
- ACTIVATE, TOFRONT, WINDOW
-
- appshell.library/TOFRONT appshell.library/TOFRONT
-
- NAME
- TOFRONT - Bring an AppShell window to the front.
-
- SYNOPSIS
- ToFrontID Function ID
- ToFrontFunc Function prototype
-
- FUNCTION
- Provides a mechanism to bring an AppShell window in front of the
- other windows on the same screen.
-
- As a string command line:
-
- TOFRONT [name]
-
- where [name] is a valid window name, defaults to MAIN.
-
- As a TagItem attribute list:
-
- APSH_NameTag, <name>
- where <name> is a valid window name.
-
- APSH_WinPointer, <pointer>
- where <pointer> points to a valid window structure.
-
- This function is implemented by the IDCMP message handler.
-
- SEE ALSO
- ACTIVATE, TOBACK, WINDOW
-
- appshell.library/VERSION appshell.library/VERSION
-
- NAME
- VERSION - Uses NotifyUser() to show the current version.
-
- SYNOPSIS
- VersionID Function ID
- VersionFunc Function prototype
-
- FUNCTION
- Uses NotifyUser() to show the current version of the application or
- the AppShell.
-
- As a string command line:
-
- VERSION [APPSHELL]
-
- [APPSHELL] To display the AppShell version. Defaults
- to showing the application version.
-
- BUGS
- No tags are implemented.
-
- appshell.library/WHY appshell.library/WHY
-
- NAME
- WHY - Return information on the last error.
-
- SYNOPSIS
- WhyID Function ID
- WhyFunc Function prototype
-
- FUNCTION
- For scripting purpose, the primary return value of a command should
- return an error level. This limits the error return values to small
- ranges (to be consistent with DOS). Therefore, if commands use the
- secondary return field to contain information on the actual error,
- then this function will allow scripts to obtain information on what
- the last error actually was.
-
- This command takes no parameters.
-
- This function is implemented by the ARexx message handler.
-
- BUGS
- Not currently implemented.
-
- appshell.library/WINDOW appshell.library/WINDOW
-
- NAME
- WINDOW - Open/Close an AppShell window
-
- SYNOPSIS
- WindowID Function ID
- WindowFunc Function prototype
-
- FUNCTION
- Provides a mechanism to open or close an AppShell window.
-
- As a string command line:
-
- WINDOW [action] [name]
-
- where [action] is an optional command, defaults to OPEN.
- OPEN To open the window.
- CLOSE To close the window.
-
- where [name] is a valid window name, defaults to MAIN.
-
- As a TagItem attribute list:
-
- APSH_NameTag, <name>
- where <name> is a valid window name.
-
- APSH_WinPointer, <pointer>
- where <pointer> points to a valid window structure.
-
- APSH_Command, <cmd>
- where <cmd> is a valid command.
- MH_OPEN To open the window.
- MH_CLOSE To close the window.
-
- This function is implemented by the IDCMP message handler.
-
- SEE ALSO
- ACTIVATE, TOBACK, TOFRONT
-
- appshell.lib/HandleApp appshell.lib/HandleApp
-
- NAME
- HandleApp - startup function for AppShell application
-
- SYNOPSIS
- results = HandleApp (argc, argv, wbm, attrs)
-
- BOOL results;
- int argc;
- char **argv;
- struct WBStartup *wbm;
- struct TagItem *attrs;
-
- FUNCTION
- This function is the application entry point to the AppShell.
-
- EXAMPLE
-
- /* ... application description tags ... */
-
- extern struct WBStartup *WBenchMsg;
-
- void main(int argc, char **argv)
- {
- HandleApp(argc, argv, WBenchMsg, tags);
- }
-
- INPUTS
- argc - Number of Shell arguments being passed.
- argv - Pointer to the Shell argument list
- wbm - Pointer to the Workbench startup message.
- attrs - Pointer to the application's user interface
- description.
-
- RESULT
- TRUE - Application was able to initialize and run.
-
- FALSE - Application failed. AppShell has already informed
- user of what and where the failure was.
-
- SEE ALSO
- HandleAppAsync()
-
- appshell.lib/NotifyUser appshell.lib/NotifyUser
-
- NAME
- NotifyUser - Display a text message to the user.
-
- SYNOPSIS
- NotifyUser (ai, msg, tl)
-
- struct AppInfo * ai;
- STRPTR msg;
- struct TagItem * tl;
-
- FUNCTION
- This function will display a text message to the user. Currently
- uses EasyRequest (AutoRequest if OS version less than 2.0) to display
- messages.
-
- INPUTS
-
- ai - Optional pointer to the AppInfo structure for this
- application.
-
- msg - Pointer to message to display. If this field is NULL, then
- the text will come from the ai->ai_TextRtn field.
-
- tl - Optional pointer to an array of TagItems.
-
- appshell.library/AddFuncEntries appshell.library/AddFuncEntries
-
- NAME
- AddFuncEntries - Add an array of entries to the function table.
-
- SYNOPSIS
- results = AddFuncEntries (ai, entries);
-
- BOOL results;
- struct AppInfo *ai;
- struct Funcs *entries;
-
- FUNCTION
- This function is used to add a NULL terminated array of entries to
- the application's function table.
-
- The function table is maintained as an Exec linked list. The AppShell
- will free all entries when the application is shutdown.
-
- INPUTS
- ai - Pointer to the application's AppInfo structure.
- entries - Pointer to a NULL terminated array of Funcs structures that
- describes the entry to be added to the function table.
-
- RESULT
- TRUE - AppShell was able to add the array to the table.
- FALSE - Unable to add the array to the function table.
-
- SEE ALSO
- AddFuncEntry()
-
- appshell.library/AddFuncEntry appshell.library/AddFuncEntry
-
- NAME
- AddFuncEntry - Add an entry to the function table
-
- SYNOPSIS
- results = AddFuncEntry (ai, entry);
-
- BOOL results;
- struct AppInfo *ai;
- struct Funcs *entry;
-
- FUNCTION
- This function is used to add a new entry to the application's
- function table.
-
- The function table is maintained as an Exec linked list. The AppShell
- will free all entries when the application is shutdown.
-
- INPUTS
- ai - Pointer to the application's AppInfo structure.
- entry - Pointer to a Funcs structure that describes the entry
- to be added to the function table.
-
- RESULT
- TRUE - AppShell was able to add the function to the table.
- FALSE - Unable to add the entry to the function table.
-
- SEE ALSO
- AddFuncEntries()
-
- appshell.library/AddProjects appshell.library/AddProjects
-
- NAME
- AddProjects - Add an array of WBArgs to the project list.
-
- SYNOPSIS
- result = AddProjects (ai, numargs, args, tl);
-
- BOOL result;
- struct AppInfo *ai;
- LONG numargs;
- struct WBArg *args;
- struct TagItem *tl;
-
- FUNCTION
- Add an array of WBArgs to the given project list. Defaults to the
- main project list.
-
- Valid TagItems are:
-
- APSH_ProjInfo,<project>
- Where <project> is a valid pointer to a Project structure.
- Defaults to the AppInfo project structure.
-
- INPUTS
- ai - Pointer to the application AppInfo structure.
- numargs - Number of arguments in the array.
- args - Pointer to an array of WBArg structures.
- tl - Pointer to an optional TagItem array.
-
- appshell.library/APSHClearPointer appshell.library/APSHClearPointer
-
- NAME
- APSHClearPointer - Restore the default pointer.
-
- SYNOPSIS
- APSHClearPointer (ai, tl);
-
- struct AppInfo * ai;
- struct TagItem * tl;
-
- FUNCTION
- This function restores the default pointer for the specified window.
- Defaults to the current window (according to AppShell).
-
- Valid TagItems are:
-
- APSH_WinName, <name>
- where <name> is a valid window name.
-
- APSH_WinPointer, <pointer>
- where <pointer> points to a valid window.
-
- INPUTS
- ai - Optional pointer to the AppInfo structure for this
- application.
- tl - Optional pointer to an array of TagItems.
-
- appshell.library/APSHGetGadgetInfo appshell.library/APSHGetGadgetInfo
-
- NAME
- APSHGetGadgetInfo - Obtain a pointer to a gadget and its window.
-
- SYNOPSIS
- success = APSHGetGadgetInfo (ai, winname, gadname, winptr, gadptr)
-
- BOOL success;
- struct AppInfo *ai;
- STRPTR winname, gadname;
- ULONG *winptr, *gadptr;
-
- FUNCTION
- Obtain a pointer to a gadget and the window that it belongs in.
-
- Always use this function to get a pointer to a gadget before
- manipulating it. Never store the gadget or window pointers in your
- UserData for the application. It is possible that the window is
- closed or been closed since the time you last obtained a gadget
- pointer and are therefore referencing invalid memory locations.
-
- This function is implemented by the IDCMP message handler.
-
- EXAMPLE
-
- /* Sample function showing how to use APSHGetGadgetInfo */
- VOID StubFunc (struct AppInfo * ai, STRPTR cmd, struct TagItem * tl)
- {
- struct Gadget *gad;
- struct Window *win;
-
- /* Get a pointer to the main window, named MAIN, and the Scrolling
- * List gadget, which is named LIST.
- */
- if (APSHGetGadgetInfo (ai, "MAIN", "LIST",
- (ULONG *)&win, (ULONG *)&gad))
- {
- /* ... do something with the fields ... */
- }
- }
-
-
- INPUTS
- ai - Pointer to the AppInfo structure
- winname - Pointer to the name of the window that the gadget is
- supposed to be located in.
- gadname - Pointer to the name of the gadget.
- winptr - Address of the variable to place the window pointer in.
- gadptr - Address of the variable to place the gadget pointer in.
-
- RETURN
- success - TRUE indicates that the system was able to locate both
- the named window and gadget (and the window is actually
- open).
-
- FALSE indicates that the system was unable to locate
- either the window or the gadget.
-
- BUGS
- This version of the AppShell has stolen the window and gadget
- UserData fields. Until a method is provided to access per window
- and gadget data, don't use the window->UserData or gadget->UserData.
-
- appshell.library/APSHGetWindowInfo appshell.library/APSHGetWindowInfo
-
- NAME
- APSHGetWindowInfo - Obtain a pointer to a window.
-
- SYNOPSIS
- success = APSHGetWindowInfo (ai, winname, winptr)
-
- BOOL success;
- struct AppInfo *ai;
- STRPTR winname;
- ULONG *winptr;
-
- FUNCTION
- Obtain a pointer to the named window.
-
- Always use this function to get a pointer to a window before
- manipulating it. Never store the window pointers in the application's
- UserData. It is possible that the window is closed or been closed
- since the time you last obtained its pointer and are therefore
- referencing invalid memory locations.
-
- This function is implemented by the IDCMP message handler.
-
- EXAMPLE
-
- /* Sample function showing how to use APSHGetWindowInfo */
- VOID StubFunc (struct AppInfo * ai, STRPTR cmd, struct TagItem * tl)
- {
- struct Window *win;
-
- /* Get a pointer to the main window, named MAIN */
- if (APSHGetWindowInfo (ai, "MAIN", (ULONG)&win))
- {
- /* ... do something with the fields ... */
- }
- }
-
-
- INPUTS
- ai - Pointer to the AppInfo structure
- winname - Pointer to the name of the window.
- winptr - Address of the variable to place the window pointer in.
-
- RETURN
- success - TRUE indicates that the system was able to locate
- the named window and that it was open.
-
- FALSE indicates that the system was unable to locate
- the named window or that it wasn't open.
-
- BUGS
- This version of the AppShell has stolen the window and gadget
- UserData fields. Until a method is provided to access per window
- and gadget data, don't use the window->UserData or gadget->UserData.
-
- appshell.library/APSHSetWaitPointer appshell.library/APSHSetWaitPointer
-
- NAME
- APSHSetWaitPointer - Display a wait pointer.
-
- SYNOPSIS
- APSHSetWaitPointer (ai, tl);
-
- struct AppInfo * ai;
- struct TagItem * tl;
-
- FUNCTION
- This function displays a wait pointer in the specified window.
- Defaults to the current window (according to AppShell).
-
- Valid TagItems are:
-
- APSH_WinName, <name>
- where <name> is a valid window name.
-
- APSH_WinPointer, <pointer>
- where <pointer> points to a valid window.
-
- INPUTS
- ai - Optional pointer to the AppInfo structure for this
- application.
- tl - Optional pointer to an array of TagItems.
-
- appshell.library/BuildParseLine appshell.library/BuildParseLine
-
- NAME
- BuildParseLine - Non-destructive string parser
-
- SYNOPSIS
- handle = BuildParseLine (line, argc, argv);
-
- STRPTR handle;
- STRPTR line;
- ULONG *argc;
- STRPTR argv[MAXARGS];
-
- FUNCTION
- This function is used to parse a string that may end up being
- passed to another function. It does not modify the passed
- string. Requires a corresponding call to FreeParseLine, when the
- application's function is done with the parsed line.
-
- INPUTS
- line - Pointer to the string to parse.
- argc - Pointer to variable to hold the number of arguments.
- argv - Pointer to an array to hold the arguments. The array
- must contain MAXARGS entries.
-
- RETURN
- handle - Pointer to a temporary work area which must be passed
- back to FreeParseLine when done with the parsed array.
-
- EXAMPLE
-
- /* sample function showing how to use BuildParseLine & FreeParseLine */
- function()
- {
- STRPTR argv[MAXARGS], handle = NULL;
- ULONG argc;
-
- /* Parse the command line */
- handle = BuildParseLine ("ACTIVATE ME", &argc, argv);
-
- /* Do something with the parsed command line. The strings
- * must be copied before calling FreeParseLine if they are
- * going to be used later.
- */
- printf("%ld words, first is %s\n", argc, argv[0]);
-
- /* free the BuildParseLine resources */
- FreeParseLine(handle);
- }
-
- SEE ALSO
- FreeParseLine(), ParseLine()
-
- appshell.library/FindType appshell.library/FindType
-
- NAME
- FindType - Find the value of a variable.
-
- SYNOPSIS
- value = FindType(argv, name, defvalue)
-
- STRPTR value;
- STRPTR argv[MAXARGS];
- STRPTR name, defvalue;
-
- FUNCTION
- This function searches a parsed text array for a given entry and
- returns a pointer to the value bound to that entry. If the entry is
- not found, then a pointer to defvalue is returned.
-
- EXAMPLE
-
- /* sample fragment showing how to use FindType */
- VOID StubFunc (struct AppInfo *ai, STRPTR cmd, struct TagItem *tl)
- {
- STRPTR name;
- STRPTR argv[MAXARG], clone=NULL;
- ULONG argc;
-
- /* make sure we have a command line */
- if (cmd)
- {
- /* parse the command line */
- clone = BuildParseLine (cmd, &argc, argv);
-
- /* Get the file name. If there isn't a FILE keyword, then
- * use "config". If the return value is to be used outside
- * of this function, then it must be copied.
- */
- name = FindType (argv, "FILE", "config");
- }
-
- /* free the BuildParseLine */
- FreeParseLine (clone);
- }
-
- INPUTS
- argv - Pointer to the preparsed text array.
- name - Entry to search for.
- defvalue - Value to return if name isn't found.
-
- RESULTS
- value - A pointer to the string that is the value bound to name or
- defvalue if name isn't found.
-
- SEE ALSO
- MatchValue(), BuildParseLine(), FreeParseLine(), ParseLine(),
- icon.library/FindToolType
-
- appshell.library/FreeParseLine appshell.library/FreeParseLine
-
- NAME
- FreeParseLine - Free the BuildParseLine temporary work area
-
- SYNOPSIS
- FreeParseLine(handle)
-
- STRPTR handle;
-
- FUNCTION
- Free the temporary work space used by BuildParseLine. A NULL is a
- valid argument.
-
- INPUTS
- handle - Pointer to the return value from BuildParseLine.
-
- SEE ALSO
- BuildParseLine(), ParseLine()
-
- appshell.library/FreeProject appshell.library/FreeProject
-
- NAME
- FreeProject - Removes and deallocate a project from the project list.
-
- SYNOPSIS
- FreeProject (proj);
-
- struct ProjNode *proj;
-
- FUNCTION
- Removes and deallocates a project node from the project list.
-
- INPUTS
- proj - Pointer to a valid ProjNode structure.
-
- appshell.library/FreeProjects appshell.library/FreeProjects
-
- NAME
- FreeProjects - Remove and deallocate all the projects in a project list.
-
- SYNOPSIS
- FreeProjects (ai, tl);
-
- struct AppInfo *ai;
- struct TagItem *tl;
-
- FUNCTION
- Removes and deallocate all the projects in a project list. Defaults
- to the main project list.
-
- Valid TagItems are:
-
- APSH_ProjInfo,<project>
- Where <project> is a valid pointer to a Project structure.
- Defaults to the AppInfo project structure.
-
- INPUTS
- ai - Pointer to the application AppInfo structure.
- tl - Pointer to an optional TagItem array.
-
- appshell.library/GetFuncEntry appshell.library/GetFuncEntry
-
- NAME
- GetFuncEntry - Get a pointer to a function table entry.
-
- SYNOPSIS
- entry = GetFuncEntry (ai, cmd, fid);
-
- struct FuncEntry *entry;
- struct AppInfo *ai;
- STRPTR cmd;
- ULONG fid;
-
- FUNCTION
- This function is used to obtain a pointer to a function table entry.
-
- Currently the FuncEntry structure is private.
-
- INPUTS
- ai - Pointer to the application's AppInfo structure.
- cmd - Pointer to the command name to locate. Either cmd or fid
- must be provided.
- fid - Command ID of the command to locate.
-
- RESULT
- entry - Pointer to a FuncEntry structure that describes the command.
-
- SEE ALSO
- GetFuncID(), GetFuncName()
-
- appshell.library/GetFuncID appshell.library/GetFuncID
-
- NAME
- GetFuncID - Given a command name, return the ID for the function.
-
- SYNOPSIS
- fid = GetFuncID (ai, cmd);
-
- ULONG fid;
- struct AppInfo *ai;
- STRPTR cmd;
-
- FUNCTION
- This function will return the command ID for the function.
-
- INPUTS
- ai - Pointer to the application's AppInfo structure.
- cmd - Pointer to the command name to locate.
-
- RESULT
- fid - Command ID of the function.
-
- SEE ALSO
- GetFuncEntry(), GetFuncName()
-
- appshell.library/GetFuncName appshell.library/GetFuncName
-
- NAME
- GetFuncName - Given a command ID, return the name of the function.
-
- SYNOPSIS
- cmd = GetFuncName (ai, fid);
-
- STRPTR cmd;
- struct AppInfo *ai;
- ULONG fid;
-
- FUNCTION
- This function will return the name of the function for the given
- command ID.
-
- INPUTS
- ai - Pointer to the application's AppInfo structure.
- fid - Command ID of the function.
-
- RESULT
- cmd - Pointer to the command name.
-
- SEE ALSO
- GetFuncEntry(), GetFuncID()
-
- appshell.library/GetProjNode appshell.library/GetProjNode
-
- NAME
- GetProjNode - Get the requested project node.
-
- SYNOPSIS
- proj = GetProjNode (ai, id, tl);
-
- struct ProjNode *proj;
- struct AppInfo *ai;
- LONG id;
- struct TagItem *tl;
-
- FUNCTION
- Given a project ID, find the correct ProjNode.
-
- Valid TagItems are:
-
- APSH_ProjInfo,<project>
- Where <project> is a valid pointer to a Project structure.
- Defaults to the AppInfo project structure.
-
- INPUTS
- ai - Pointer to the application AppInfo structure.
- id - Project ID to locate.
- tl - Pointer to an optional TagItem array.
-
- appshell.library/GetText appshell.library/GetText
-
- NAME
- GetText - Obtain a pointer to a permanent read-only text message.
-
- SYNOPSIS
- text = GetText(ai, base, id, def)
-
- STRPTR text;
- struct AppInfo *ai;
- ULONG base, id;
- STRPTR def;
-
- FUNCTION
- Used to obtain a pointer to a permanent text message. The text
- return value must not be modified.
-
- The main use for this function is for setting up text labels.
-
- EXAMPLE
-
- /* sample function to show how to use GetText */
- VOID StubFunc (struct AppInfo *ai, STRPTR cmd, struct TagItem *tl)
- {
- STRPTR label;
-
- /* get the current text to use for Okay */
- label = GetText (ai, APSH_MAIN_ID, APSH_OKAY_TXT, NULL);
- }
-
- INPUTS
- ai - Pointer to the AppInfo structure for this application.
- base - Text table to use.
-
- APSH_USER_ID for the application text table.
- APSH_MAIN_ID for the AppShell text table.
- or may provide a custom message handler base ID.
-
- id - Text Table entry id.
- def - Must be NULL.
-
- SEE ALSO
- PrepText()
-
- appshell.library/HandleAppAsync appshell.library/HandleAppAsync
-
- NAME
- HandleAppAsync - startup function for an asynchronous AppShell
- application.
-
- SYNOPSIS
- results = HandleAppAsync (attrs, sipc)
-
- BOOL results;
- struct TagItem *attrs;
- struct MsgPort *sipc;
-
- FUNCTION
- This function is the application entry point for an asynchronous
- AppShell application. This function should be called via the
- Tool Message Handler and allows an AppShell application to have
- multiple projects each with their own process.
-
- EXAMPLE
-
- /* This example shows how an application can clone itself to handle
- * multiple projects.
- *
- * APSH_Tool the name to give to the cloned process.
- * APSH_ToolAddr the function to run ansynchronously.
- * APSH_ToolData the user interface tag description.
- */
- VOID CloneFunc(struct AppInfo *ai, STRPTR args, struct TagItem *tl)
- {
- HandlerFunc (ai,
- APSH_Handler, "TOOL",
- APSH_Command, MH_OPEN,
- APSH_Tool, "AppShell_Clone",
- APSH_ToolAddr, HandleAppAsync,
- APSH_ToolData, Cloned_App,
- TAG_DONE);
- }
-
- INPUTS
- attrs - Pointer to the application's user interface
- description.
-
- sipc - SIPC message port by which the master application
- can control the cloned application.
-
- RESULT
- TRUE - Application was able to initialize and run.
-
- FALSE - Application failed. AppShell has already informed
- user of what and where the failure was.
-
- SEE ALSO
- HandleApp()
-
- appshell.library/HandlerData appshell.library/HandlerData
-
- NAME
- HandlerData - Obtain a pointer to a message handlers' instance data
-
- SYNOPSIS
- ap = HandlerData (struct AppInfo *ai, ULONG tags, ...)
-
- APTR ap;
- struct AppInfo *ai;
- ULONG tags, ...
-
- OR
-
- ap = HandlerDataA (struct AppInfo *ai, struct TagItem *tl)
-
- APTR ap;
- struct AppInfo *ai;
- struct TagItem *tl;
-
- FUNCTION
- Used to obtain a pointer to a message handlers' instance data.
- HandlerData is the stack-based variable argument interface, while
- HandlerDataA is the TagItem array interface.
-
- EXAMPLE
-
- /* sample stub function to show how to obtain a message handlers'
- * data
- */
- VOID StubFunc(struct AppInfo *ai, STRPTR cmd, struct TagItem *tl)
- {
- struct MsgHandler *mh;
- struct MHObject *mho;
- struct myhInfo *md;
-
- /* get a pointer to the message handler data */
- if (mho = (struct MHObject *)
- HandlerData(ai,APSH_Handler,"MYH",TAG_DONE))
- {
- /* get a pointer to the instance data */
- md = mho->mho_SysData;
- }
- }
-
- INPUTS
- ai - pointer to the AppInfo structure for this application.
- tags - stack based TagItems.
-
- RESULTS
- ap - Pointer to the message handler instance data.
-
- SEE ALSO
- HandlerFunc()
-
- appshell.library/HandlerFunc appshell.library/HandlerFunc
-
- NAME
- HandlerFunc - entry point for a low-level message handler function.
-
- SYNOPSIS
- HandlerFunc (struct AppInfo *ai, ULONG tags, ...)
-
- struct AppInfo *ai;
- ULONG tags, ...
-
- OR
-
- HandlerFuncA (struct AppInfo *ai, struct TagItem *tl)
-
- struct AppInfo *ai;
- struct TagItem *tl;
-
- FUNCTION
- Provides an entry point for the low-level message handler functions.
- HandlerFunc is the stack-based variable argument interface, while
- HandlerFuncA is the TagItem array interface.
-
- EXAMPLE
-
- /* sample stub function to show how to call a low-level message
- * handler function.
- *
- * This example tells the IDCMP message handler to open the window
- * (and it's environment) named MAIN.
- */
- VOID StubFunc(struct AppInfo *ai, STRPTR cmd, struct TagItem *tl)
- {
- HandlerFunc(ai,
- APSH_Handler, "IDCMP",
- APSH_Command, MH_OPEN,
- APSH_NameTag, "MAIN",
- TAG_DONE);
- }
-
- INPUTS
- ai - pointer to the AppInfo structure for this application.
- tags - stack based TagItems.
-
- SEE ALSO
- HandlerData()
-
- appshell.library/IconFromWBArg appshell.library/IconFromWBArg
-
- NAME
- IconFromWBArg - Obtains the icon for a Workbench argument.
-
- SYNOPSIS
- dob = IconFromWBArg (wbarg);
-
- struct DiskObject *dob;
- struct WBArg *wbarg;
-
- FUNCTION
- Given a valid Workbench argument, this command will return the
- proper icon. This call uses the new (V36) GetDiskObjectNew call
- to ensure that an icon will be returned.
-
- INPUTS
- wbarg - Pointer to a filled in WBArg structure.
-
- RESULTS
- dob - Pointer to a DiskObject structure. Application must call
- FreeDiskObject when done with the icon.
-
- appshell.library/MatchValue appshell.library/MatchValue
-
- NAME
- MatchValue - Check a text argument for a particular flag.
-
- SYNOPSIS
- value = MatchValue(entry, value)
-
- BOOL value;
- STRPTR entry, value;
-
- FUNCTION
- This function searchs to see if a particular text flag is set in
- a text entry.
-
- EXAMPLE
-
- /* sample fragment showing how to use MatchValue */
- VOID StubFunc (struct AppInfo *ai, STRPTR cmd, struct TagItem *tl)
- {
- STRPTR flagstr;
- ULONG flags = NULL;
- STRPTR argv[MAXARG], clone=NULL;
- ULONG argc;
-
- /* make sure we have a command line */
- if (cmd)
- {
- /* parse the command line */
- clone = BuildParseLine (cmd, &argc, argv);
-
- /* get the flag entry from the argument list */
- if (flagstr = FindType (argv, "FLAGS", NULL))
- {
- /* see if the CLOSE flag is present */
- if (MatchValue (flagstr, "CLOSE"))
- flags |= CLOSEWINDOW;
-
- /* see if the SIZE flag is present */
- if (MatchValue (flagstr, "SIZE"))
- flags |= NEWSIZE;
- }
- }
-
- /* free the BuildParseLine */
- FreeParseLine (clone);
- }
-
- INPUTS
- entry - Entry to search in.
- value - Value to search for.
-
- RESULTS
- value - TRUE if the value was in the entry, otherwise returns
- FALSE.
-
- SEE ALSO
- FindType(), BuildParseLine(), FreeParseLine(), ParseLine(),
- icon.library/MatchToolValue
-
- appshell.library/NewProject appshell.library/NewProject
-
- NAME
- NewProject - Create a project node and add it to the project list.
-
- SYNOPSIS
- proj = NewProject (ai, name, tl);
-
- struct ProjNode *proj;
- struct AppInfo *ai;
- STRPTR name;
- struct TagItem *tl;
-
- FUNCTION
- Creates a project node of the given name and adds it to the requested
- project list. The project list defaults to the main project list.
- If the name is NULL, the function will determine the name by finding
- the next available Unnamed slot.
-
- Valid TagItems are:
-
- APSH_ProjInfo, <project>
- Where <project> is a valid pointer to a Project structure.
- Defaults to the AppInfo project structure.
-
- APSH_NameTag, <name>
- Where <name> is the name to be added to the project list.
-
- APSH_TextID, <text ID>
- Where <text ID> is the text ID from the applications text
- table to use for the prefix when a name isn't given. Defaults
- to Unnamed from the AppShell text table. The resulting
- prefix will be truncated to twenty characters.
-
- APSH_BaseID, <base ID>
- Where <base ID> is the text table to use when APSH_TextID is
- supplied. Defaults to APSH_USER_ID.
-
- INPUTS
- ai - Pointer to the application AppInfo structure.
- name - Pointer to the name to give to the project.
- tl - Pointer to an optional TagItem array.
-
- RESULT
- proj - Pointer to a filled in ProjNode structure
-
- appshell.library/ParseLine appshell.library/ParseLine
-
- NAME
- ParseLine - Destructive string parser
-
- SYNOPSIS
- argc = ParseLine (line, argv);
-
- ULONG argc;
- STRPTR line;
- STRPTR argv[MAXARGS];
-
- FUNCTION
- String parser. Inserts '\0' after each word in the passed text
- line.
-
- INPUTS
- line - Pointer to the string to parse.
- argv - Pointer to an array to hold the arguments. The array
- must contain MAXARGS entries.
-
- RETURN
- argc - Number of arguments returned in argv
-
- EXAMPLE
-
- /* sample function showing how to use ParseLine */
- VOID StubFunc (struct AppInfo *ai, STRPTR cmd, struct TagItem *tl)
- {
- UBYTE text[] = "ACTIVATE ME";
- STRPTR argv[MAXARGS];
- ULONG argc;
-
- /* parse the command line */
- argc = ParseLine (text, argv);
-
- /* simple display of some of the parse variables */
- printf("%ld words, first is %s\n", argc, argv[0]);
- }
-
- SEE ALSO
- BuildParseLine(), FreeParseLine()
-
- appshell.library/PerfFunc appshell.library/PerfFunc
-
- NAME
- PerfFunc - The entry point to all commands in the function table.
-
- SYNOPSIS
- PerfFunc (ai, fid, cmdline, attrs)
-
- struct AppInfo *ai;
- ULONG fid;
- STRPTR cmdline;
- struct TagItem *attrs;
-
- FUNCTION
- This is the main and only entry point for all commands in the
- function table. In order to respect state, such as whether the
- function is enabled or disabled, function table commands should
- never be called directly.
-
- If the function isn't in the function table and the ARexx message
- handler has been initialized, then the command is passed to ARexx.
-
- EXAMPLE
-
- /* how to call a function using its ID */
- PerfFunc (ai, QuitID, NULL, NULL);
-
- /* how to call a function using its name */
- PerfFunc (ai, NULL, "QUIT", NULL);
-
-
- INPUTS
- ai - Pointer to the AppInfo structure
- fid - ID of function to perform.
- cmdline - Pointer to the text command line to use to trigger the
- command.
- attrs - Pointer to the TagItem array to use to triggered the
- command.
-
- appshell.library/PrepText appshell.library/PrepText
-
- NAME
- PrepText - Obtain a pointer to a temporary modifiable text message.
-
- SYNOPSIS
- text = PrepText(ai, base, id, args, ...)
-
- STRPTR text;
- struct AppInfo *ai;
- ULONG base, id;
- APTR args;
-
- FUNCTION
- Build a temporary text message using a text table entry and the
- passed arguments. The text table entry must contain valid
- RawDoFmt formatting commands.
-
- The text pointer is only valid until the next call to PrepText.
- There is one PrepText buffer per AppInfo, so each cloned AppShell
- has its own work buffer. The string must be copied to a more
- permanent storage place if you wish to keep it for a longer period.
-
- The main use for this function is for formatting of temporary
- error messages.
-
- EXAMPLE
-
- /* set up error return values */
- ai->ai_Pri_Ret = RETURN_FAIL;
- ai->ai_Sec_Ret = APSH_PORT_ACTIVE;
-
- /* "%s port already active", pname */
- ai->ai_TextRtn = PrepText(ai, APSH_MAIN_ID, ai->ai_Sec_Ret, pname);
-
-
- INPUTS
- ai - Pointer to the AppInfo structure for this application.
- base - Text table to use.
-
- APSH_USER_ID for the application text table.
- APSH_MAIN_ID for the AppShell text table.
- or may provide a custom message handler base ID.
-
- id - Text Table entry id.
- args - Variables to be sprintf'ed into the text entry.
-
- SEE ALSO
- GetText()
-
- appshell.library/QStrCmpI appshell.library/QStrCmpI
-
- NAME
- QStrCmpI - Quick case insensitive string comparision.
-
- SYNOPSIS
- success = QStrCmpI (str1, str2);
-
- BOOL value;
- STRPTR str1, str2;
-
- FUNCTION
- This function performs a quick, case insensitive, string comparision.
- Stops as soon as it determines that the strings are not the same.
-
- EXAMPLE
-
- /* sample code fragment showing how to use QStrCmpI */
- VOID StubFunc (struct AppInfo *ai, STRPTR cmd, struct TagItem *tl)
- {
- STRPTR name;
- STRPTR argv[MAXARG], clone=NULL;
- ULONG argc;
-
- /* make sure we have a command line */
- if (cmd)
- {
- /* parse the command line */
- clone = BuildParseLine (cmd, &argc, argv);
-
- /* make sure we have some arguments */
- if (argc >= 2L)
- {
- /* check to see if the first argument is CLOSE.
- * Note that FindType(argv, "CLOSE", NULL) could also be
- * used in this example.
- */
- if (QStrCmpI (argv[1], "CLOSE"))
- {
- /* do something because of CLOSE */
- }
- }
- }
-
- /* free the BuildParseLine */
- FreeParseLine (clone);
- }
-
- INPUTS
- str1 - Pointer to the first string.
- str2 - Pointer to the second string.
-
- RESULTS
- value - TRUE if the strings are the same, otherwise returns FALSE.
-
- appshell.library/RemoveMsgPort appshell.library/RemoveMsgPort
-
- NAME
- RemoveMsgPort - Safely remove a message port.
-
- SYNOPSIS
- RemoveMsgPort (mp);
-
- struct MsgPort *mp;
-
- FUNCTION
- This function will remove and reply to all messages that are
- outstanding on a message port before removing the port itself.
-
- NULL is a valid argument.
-
- INPUTS
- mp - A pointer to the message port to delete.
-
- appshell.library/RemoveProject appshell.library/RemoveProject
-
- NAME
- RemoveProject - Remove a project node from the project list.
-
- SYNOPSIS
- BOOL RemoveProject (ai, name, tl);
-
- struct AppInfo *ai;
- STRPTR name;
- struct TagItem *tl;
-
- FUNCTION
- Removes a project node of the given name from the requested project
- list. Defaults to removing the current project node from the main
- project list.
-
- Valid TagItems are:
-
- APSH_ProjInfo, <project>
- Where <project> is a valid pointer to a Project structure.
- Defaults to the AppInfo project structure.
-
- APSH_NameTag, <name>
- Where <name> is a valid project name to be removed.
-
- INPUTS
- ai - Pointer to the application AppInfo structure.
- name - Pointer to the name of the project to be removed.
- tl - Pointer to an optional TagItem array.
-
- RESULT
- TRUE - Able to remove the project from the list.
- FALSE - Unable to remove the project.
- appshell.library/SwapProjNodes appshell.library/SwapProjNodes
-
- NAME
- SwapProjNodes - Swap two project nodes within the same Project list.
-
- SYNOPSIS
- SwapProjNodes (ai, pn1, pn2, tl);
-
- struct AppInfo *ai;
- struct ProjNode *pn1;
- struct ProjNode *pn2;
- struct TagItem *tl;
-
- FUNCTION
- This function will swap two project nodes within the same project
- list.
-
- Valid TagItems are:
-
- APSH_ProjInfo,<project>
- Where <project> is a valid pointer to a Project structure.
- Defaults to the AppInfo project structure.
-
- INPUTS
- ai - Pointer to the application AppInfo structure.
- pn1 - Pointer to a valid ProjNode structure.
- pn2 - Pointer to a valid ProjNode structure.
- tl - Pointer to an optional TagItem array.
-
-